#pragma once
#include "fxcc/core/AssertManager.h"
#include "fxcc/imgui/FileSystemLayer.h"

#include "e2d/yml/impl/FinalSerializer.h"

#include "e2d/core/Settings.h"
#include "e2d/core/components.h"

#include "e2d/ui/State.h"
#include "e2d/ui/Temps.h"

namespace e2d
{

	struct CustumFileSystemLayer :public fxcc::imgui::FileSystemLayer
	{
        CustumFileSystemLayer();

        void LoadIconTexture(const std::string& path, fxcc::FileType type);

        void LoadFilesInDir(fxcc::Dir* inst);

        void OnLoad() ;

        ImTextureID GetIconTexture(fxcc::File* file) ;
        
        void OnRefresh();

        void OnWindowContextItem() override;

        void ViewFunc() override;

        void TableView();

        void Grid(fxcc::File* file);

        std::vector<fxcc::File*> GetAllFilesSelected();

        void EditFile(fxcc::File* file);

        void OnDestroy() override;
    public:

        std::string m_CurrentPathStr;

        void OnSavePath();

        void OnLoadPath();

        static std::string CH_Path();

    public:
        bool m_ToolsPanelShow{ 0 };
		
        std::string m_NewFileName{ 0 };

    private:
        bool AddEffectsDescFile(const std::string& fn);

        bool AddEffectsDescFileDefault();

	};

};